#ifndef GENERATER_H
#define GENERATER_H

#include "log_elem.h"

typedef struct GraphGenerater {
    void *opaque;
    int (*process_log) (void * opaque, LogElem *le);
    int (*generate) (void *opaque, FILE *out);
    int (*destruct) (void *opaque);
} GraphGenerater;

#define GENERATER_ERR -1
#define GENERATER_OK 0

static inline int process_log (GraphGenerater *gen, LogElem *le) {
    return gen->process_log (gen->opaque, le);
}

static inline int graph_gernerate (GraphGenerater *gen, FILE* out) {
    return gen->generate (gen->opaque, out);
}

int default_graph_generater_create (GraphGenerater **gen);

#endif